<div data-page-top></div>
<div data-page-content>
	<div data-page-search>
		<div class="col-md-6">
			<div class="form-group">
				<label class="col-md-3 control-label">店主名称：</label>
				<div class="col-md-8">
					<input type="text" ng-model="vo.keeperName" class="form-control">
				</div>
			</div>
		</div>
		<div class="col-md-6">
			<div class="form-group">
				<label class="col-md-3 control-label">店铺名：</label>
				<div class="col-md-8">
					<input type="text" ng-model="vo.name" class="form-control">
				</div>
			</div>
		</div>
		<div class="col-md-6">
			<div class="form-group">
				<label class="col-md-3 control-label">店主手机号：</label>
				<div class="col-md-8">
					<input type="text" ng-model="vo.mobile" class="form-control">
				</div>
			</div>
		</div>
		<div class="col-md-6">
			<div class="form-group">
				<label class="col-md-3 control-label">店铺状态：</label>
				<div class="col-md-8">
					<select type="text" ng-model="vo.state" class="form-control">
					<option value="">请选择</option>
					<option value="0">启用</option>
					<option value="1">停用</option>
					</select>
				</div>
			</div>
		</div>
		<div class="col-md-6">
			<div class="form-group">
				<label class="col-md-3 control-label">指令测试：</label>
				<div class="col-md-8">
				<div test-directive code="shoptype" value="vo.type"></div>
				</div>
			</div>
		</div>
	
	</div>
	<div class="table-toolbar">
		<div class="btn-group">
			<a href="#/addShop.html" class="btn blue">
				<i class="fa fa-plus"></i> 新增店铺
			</a>
		</div>
	</div>
	<div class="table-container">
		<table class="table table-striped table-bordered table-hover table-btns"
			id="datatable_ajax" aria-describedby="datatable_products_info"
			role="grid">
			<thead>
				<tr class="heading">
					<th width="5%">序号</th>
					<th>店铺id</th>
					<th >店铺名称</th>
					<th >店主名称</th>
                    <th >手机号</th>
                    <th >店铺地址</th>
                    <th >创建时间</th>
                    <th >状态</th>
                    <th >操作</th>
				</tr>
			</thead>
			<tbody>
				<tr class="odd gradeX" ng-repeat="item in vm.items" >
				   <td ng-bind="$index+1"></td>
				   <td ng-bind="item.id"></td>
                   <td ng-bind="item.name"></td>
                   <td ng-bind="item.keeperName"></td>
                   <td ng-bind="item.mobile"></td>
                   <td >{{item.province}}{{item.city}}{{item.county}}{{item.street}}{{item.address}}</td>
                   <td ng-bind="item.createTime | date:'yyyy-MM-dd HH:mm:ss'"></td>
                   <td >
                   		 <span ng-repeat="stateItem in shopStateList" 
                   			class="label label-sm label-{{stateItem.stateColor}}"
                   			ng-if="stateItem.state==item.state">{{stateItem.stateName}}</span>
                   </td>
                   <td>
                    <a href="#/shopMenu/{{item.id}}/shopDetail" class="btn btn-xs default btn-editable">
                   	 	<i class="fa fa-file-text-o"></i> 详情  </a>
                   	 <button ng-click="startShop(item.id)" class="btn btn-xs default btn-editable" ng-if="item.state==1">
                    	<i class="fa fa-lock"></i> 启用</button> 
                    <button ng-click="stopShop(item.id)" class="btn btn-xs default btn-editable" ng-if="item.state==0">
                    	<i class="fa fa-lock"></i> 停用</button> 
                    <button ng-click="initUnifySaleProduct(item.id)" class="btn btn-xs default btn-editable" ng-if="item.state==0">
                    	<i class="fa fa-repeat"></i> 同步统销商品  </button> 
                   </td>
               </tr>
			</tbody>
		</table>
		<pagination boundary-links="true"
			items-per-page="vm.page.size"
			total-items="vm.page.totalResult" ng-model="vm.page.index"
			class="pagination-sm pull-right" previous-text="&lsaquo;"
			next-text="&rsaquo;" first-text="&laquo;" last-text="&raquo;"
			ng-change="getShopList()"></pagination>
		<h5>每页 {{vm.page.size}}条 | 共 {{vm.page.totalResult}}
			条记录 | 当前第 {{vm.page.index}} 页 | 共 {{vm.page.totalPage}} 页</h5>
	</div>
</div>
